/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package View;

import Controller.CodeBarre;
import Controller.Fournisseur;
import Controller.Marque;
import Controller.Ordinateur;
import Controller.Salle;
import Controller.Secteur;
import Model.FournisseurDAO;
import Model.MarqueDAO;
import Model.SalleDAO;
import Model.SecteurDAO;
import java.sql.Connection;
import java.util.Calendar;
import java.util.HashMap;
import java.util.Map;

/**
 *
 * @author Romain
 */
public class jframeOrdinateur extends javax.swing.JFrame {

  private Connection connect;
  private Controller.Type leType;
    /**
     * Creates new form jframeMateriel
     */
    public jframeOrdinateur(Connection connect, Controller.Type type){
        initComponents();
        this.leType = type;
        this.connect = connect;
        this.initCbo();
    }
    
    public void initCbo()
    {
        this.connect = connect;
		FournisseurDAO fournisseurDAO = new FournisseurDAO(connect);
		MarqueDAO marqueDAO = new MarqueDAO(connect);
		SalleDAO salleDAO = new SalleDAO(connect);
		SecteurDAO secteurDAO = new SecteurDAO(connect);
		
		Map<Integer, Fournisseur> fournisseurs = new HashMap();

		fournisseurs = fournisseurDAO.findAll();
		for (Integer mapKey : fournisseurs.keySet()) {
		  // utilise ici hashMap.get(mapKey) pour accéder aux valeurs
		  cboFournisseur.addItem(fournisseurs.get(mapKey));
		}
		
		Map<Integer,Marque> marques = new HashMap();
		marques = marqueDAO.findAll();
		for (Integer mapKey : marques.keySet()) {
		  // utilise ici hashMap.get(mapKey) pour accéder aux valeurs
		  cboMarque.addItem(marques.get(mapKey));
		}
		
		Map<Integer,Salle> salles = new HashMap();
		salles = salleDAO.findAll();
		for (Integer mapKey : salles.keySet()) {
		  // utilise ici hashMap.get(mapKey) pour accéder aux valeurs
		  cboSalle.addItem(salles.get(mapKey));
		}
		
		Map<Integer,Secteur> secteurs = new HashMap();
		secteurs = secteurDAO.findAll();
		for (Integer mapKey : secteurs.keySet()) {
		  // utilise ici hashMap.get(mapKey) pour accéder aux valeurs
		  cboSecteur.addItem(secteurs.get(mapKey));
		}
    }
    
    public Ordinateur creerOrdi()
    {
        try {
            Ordinateur ordi = new Ordinateur();
            ordi.setNumCompta(0);
            ordi.setNumSerie(this.tfNumeroDeSerie.getText());
            ordi.setNom(this.tfNom.getText());
            ordi.setDescriptif(this.tfDescriptif.getText());
            
            Calendar gc = Calendar.getInstance();
            gc.set(Integer.valueOf(this.cboDateAchatAnnee.getSelectedItem().toString()),Integer.valueOf(this.cboDateAchatMois.getSelectedItem().toString()) - 1,Integer.valueOf(this.cboDateAchatJour.getSelectedItem().toString()));
            ordi.setDateHT(gc.getTime());
            
            ordi.setPrixHT(Double.valueOf(this.tfPrix.getText()));
            ordi.setGarantie(Integer.valueOf(this.tfGarantie.getText()));
            ordi.setNumBC(this.tfBonDeCommande.getText());
            ordi.setBudget("");
            ordi.setAmortissement(Integer.valueOf(this.tfAmortissement.getText()));
            ordi.setType(this.leType);
            ordi.setFournisseur((Fournisseur) this.cboFournisseur.getSelectedItem());
            ordi.setMarque((Marque) this.cboMarque.getSelectedItem());
            ordi.setSalle((Salle) this.cboSalle.getSelectedItem());
            ordi.setSecteur((Secteur) this.cboSecteur.getSelectedItem());
            ordi.setProc(this.tfProcesseur.getText());
            ordi.setSE(this.tfOS.getText());
            ordi.setDD(this.tfDisqueDur.getText());
            ordi.setRAM(this.tfRam.getText());
            ordi.setCMere(this.tfCarteMere.getText());
            ordi.setCSon(this.tfCarteSon.getText());
            ordi.setCGraph(this.tfCarteGraphique.getText());
            ordi.setCRes(this.tfCarteReseau.getText());
            ordi.setNbFloppy(Integer.valueOf(this.tfLecteurDisquette.getText()));
            ordi.setNbZip(Integer.valueOf(this.tfLecteurZip.getText()));
            ordi.setNbCD(Integer.valueOf(this.tfLecteurCD.getText()));
            ordi.setNbDVD(Integer.valueOf(this.tfLecteurDVD.getText()));
            ordi.setNbCDRW(Integer.valueOf(this.tfGraveurCD.getText()));
            ordi.setNbDVDmRW(Integer.valueOf(this.tfGraveurmDVD.getText()));
            ordi.setNbDVDpRW(Integer.valueOf(this.tfGraveurpDVD1.getText()));
            ordi.setNbDVDpmRW(Integer.valueOf(this.tfGraveurpmDVD.getText()));
            
            
            
            
            
            CodeBarre cb = new CodeBarre(ordi, connect);
            ordi.setNumCB(cb.creerCodeBarre());
            
            

            return ordi;
        } catch (Exception e) {
            return null;
        }
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jTextField1 = new javax.swing.JTextField();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        tfNumeroDeSerie = new javax.swing.JTextField();
        jLabel3 = new javax.swing.JLabel();
        tfNom = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        tfDescriptif = new javax.swing.JTextField();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        tfPrix = new javax.swing.JTextField();
        jLabel7 = new javax.swing.JLabel();
        tfGarantie = new javax.swing.JTextField();
        jLabel8 = new javax.swing.JLabel();
        tfBonDeCommande = new javax.swing.JTextField();
        jLabel9 = new javax.swing.JLabel();
        tfAmortissement = new javax.swing.JTextField();
        cboFournisseur = new javax.swing.JComboBox();
        cboMarque = new javax.swing.JComboBox();
        cboSalle = new javax.swing.JComboBox();
        cboSecteur = new javax.swing.JComboBox();
        jLabel10 = new javax.swing.JLabel();
        tfProcesseur = new javax.swing.JTextField();
        jLabel11 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        jLabel15 = new javax.swing.JLabel();
        jLabel16 = new javax.swing.JLabel();
        jLabel17 = new javax.swing.JLabel();
        jLabel18 = new javax.swing.JLabel();
        jLabel19 = new javax.swing.JLabel();
        jLabel20 = new javax.swing.JLabel();
        jLabel21 = new javax.swing.JLabel();
        jLabel22 = new javax.swing.JLabel();
        jLabel23 = new javax.swing.JLabel();
        jLabel24 = new javax.swing.JLabel();
        tfDisqueDur = new javax.swing.JTextField();
        tfOS = new javax.swing.JTextField();
        tfRam = new javax.swing.JTextField();
        tfCarteMere = new javax.swing.JTextField();
        tfCarteSon = new javax.swing.JTextField();
        tfCarteGraphique = new javax.swing.JTextField();
        tfCarteReseau = new javax.swing.JTextField();
        tfLecteurDisquette = new javax.swing.JTextField();
        tfLecteurZip = new javax.swing.JTextField();
        tfLecteurCD = new javax.swing.JTextField();
        tfLecteurDVD = new javax.swing.JTextField();
        tfGraveurCD = new javax.swing.JTextField();
        tfGraveurmDVD = new javax.swing.JTextField();
        jLabel25 = new javax.swing.JLabel();
        jLabel26 = new javax.swing.JLabel();
        jLabel27 = new javax.swing.JLabel();
        jLabel28 = new javax.swing.JLabel();
        bEnregistrer = new javax.swing.JButton();
        bAnnuler = new javax.swing.JButton();
        tfGraveurpDVD1 = new javax.swing.JTextField();
        jLabel29 = new javax.swing.JLabel();
        jLabel30 = new javax.swing.JLabel();
        tfGraveurpmDVD = new javax.swing.JTextField();
        cboDateAchatJour = new javax.swing.JComboBox();
        cboDateAchatMois = new javax.swing.JComboBox();
        cboDateAchatAnnee = new javax.swing.JComboBox();

        jTextField1.setText("jTextField1");

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jLabel1.setFont(new java.awt.Font("Arial Black", 0, 14)); // NOI18N
        jLabel1.setText("Ordinateur");

        jLabel2.setText("Numero de Serie :");

        jLabel3.setText("Nom :");

        jLabel4.setText("Descriptif :");

        jLabel5.setText("Date d'achat :");

        jLabel6.setText("Prix ( HT ) :");

        jLabel7.setText("Duree Garantie ( M ) : ");

        jLabel8.setText("Bon de commande : ");

        jLabel9.setText("Amorti le :");

        tfAmortissement.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tfAmortissementActionPerformed(evt);
            }
        });

        cboFournisseur.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cboFournisseurActionPerformed(evt);
            }
        });

        jLabel10.setText("Processeur :");

        jLabel11.setText("Disque Dur :");

        jLabel12.setText("RAM :");

        jLabel13.setText("Carte Mere :");

        jLabel14.setText("Carte Son :");

        jLabel15.setText("Carte Graphique :");

        jLabel16.setText("Carte Reseau :");

        jLabel17.setText("OS :");

        jLabel18.setText("Nombre de :");

        jLabel19.setText("- Lect. de Disquettes");

        jLabel20.setText("- Lect.ZIP");

        jLabel21.setText("- Lect.CD");

        jLabel22.setText("- Lect.DVD");

        jLabel23.setText("- Grav. CDRW");

        jLabel24.setText("- Grav. DVDmRW");

        tfRam.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tfRamActionPerformed(evt);
            }
        });

        tfCarteGraphique.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tfCarteGraphiqueActionPerformed(evt);
            }
        });

        tfLecteurDVD.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tfLecteurDVDActionPerformed(evt);
            }
        });

        jLabel25.setText("Marque");

        jLabel26.setText("Fournisseur");

        jLabel27.setText("Salle");

        jLabel28.setText("Secteur");

        bEnregistrer.setText("Enregistrer");
        bEnregistrer.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bEnregistrerActionPerformed(evt);
            }
        });

        bAnnuler.setText("Annuler");
        bAnnuler.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bAnnulerActionPerformed(evt);
            }
        });

        jLabel29.setText("- Grav. DVDpRW");

        jLabel30.setText("- Grav. DVDpmRW");

        cboDateAchatJour.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31" }));

        cboDateAchatMois.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12" }));

        cboDateAchatAnnee.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "1990", "1991", "1992", "1993", "1994", "1995", "1996", "1997", "1998", "1999", "2000", "2001", "2002", "2003", "2004", "2005", "2006", "2007", "2008", "2009", "2010", "2011", "2012", "2013", "2014", "2015", "2016", "2017", "2018", "2019", "2020" }));

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jLabel1)
                .addGap(183, 183, 183))
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addComponent(jLabel12)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel29)
                            .addComponent(jLabel20)
                            .addComponent(jLabel19)
                            .addComponent(jLabel21)
                            .addComponent(jLabel22)
                            .addComponent(jLabel23)
                            .addComponent(jLabel24))
                        .addGap(85, 85, 85))
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel8)
                                    .addComponent(jLabel10)
                                    .addComponent(jLabel13)
                                    .addComponent(jLabel14)
                                    .addComponent(jLabel16))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(layout.createSequentialGroup()
                                        .addGap(11, 11, 11)
                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                            .addComponent(tfCarteReseau, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                                .addComponent(tfCarteMere, javax.swing.GroupLayout.DEFAULT_SIZE, 59, Short.MAX_VALUE)
                                                .addComponent(tfRam, javax.swing.GroupLayout.Alignment.LEADING)
                                                .addComponent(tfDisqueDur, javax.swing.GroupLayout.Alignment.LEADING)
                                                .addComponent(tfCarteSon)
                                                .addComponent(tfCarteGraphique)))
                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(layout.createSequentialGroup()
                                                .addGap(82, 82, 82)
                                                .addComponent(jLabel18))
                                            .addGroup(layout.createSequentialGroup()
                                                .addGap(68, 68, 68)
                                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                                    .addGroup(layout.createSequentialGroup()
                                                        .addComponent(jLabel30)
                                                        .addGap(37, 37, 37)
                                                        .addComponent(tfGraveurpmDVD, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                                            .addComponent(tfLecteurDisquette, javax.swing.GroupLayout.DEFAULT_SIZE, 25, Short.MAX_VALUE)
                                                            .addComponent(tfLecteurZip)
                                                            .addComponent(tfLecteurCD)
                                                            .addComponent(tfLecteurDVD))
                                                        .addComponent(tfGraveurCD, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(tfGraveurmDVD, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(tfGraveurpDVD1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))))))
                                    .addComponent(tfBonDeCommande, javax.swing.GroupLayout.PREFERRED_SIZE, 131, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGroup(layout.createSequentialGroup()
                                        .addComponent(tfProcesseur, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(jLabel17)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(tfOS, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE))))
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                                                .addComponent(jLabel3)
                                                .addGap(72, 72, 72))
                                            .addGroup(layout.createSequentialGroup()
                                                .addComponent(jLabel4)
                                                .addGap(48, 48, 48)))
                                        .addGroup(layout.createSequentialGroup()
                                            .addComponent(jLabel5)
                                            .addGap(32, 32, 32)))
                                    .addGroup(layout.createSequentialGroup()
                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jLabel6)
                                            .addComponent(jLabel2))
                                        .addGap(14, 14, 14)))
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(layout.createSequentialGroup()
                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                                .addComponent(tfNom, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 132, Short.MAX_VALUE)
                                                .addComponent(tfPrix)
                                                .addComponent(tfNumeroDeSerie))
                                            .addGroup(layout.createSequentialGroup()
                                                .addComponent(cboDateAchatJour, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(cboDateAchatMois, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(cboDateAchatAnnee, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(layout.createSequentialGroup()
                                                .addComponent(jLabel7)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(tfGarantie, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE))
                                            .addGroup(layout.createSequentialGroup()
                                                .addComponent(jLabel9)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(tfAmortissement, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE))))
                                    .addComponent(tfDescriptif, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addComponent(jLabel11)
                            .addComponent(jLabel15)
                            .addGroup(layout.createSequentialGroup()
                                .addGap(96, 96, 96)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(layout.createSequentialGroup()
                                        .addGap(158, 158, 158)
                                        .addComponent(bAnnuler))
                                    .addComponent(bEnregistrer)))
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(cboFournisseur, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel26))
                                .addGap(39, 39, 39)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(cboMarque, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel25))
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(layout.createSequentialGroup()
                                        .addGap(174, 174, 174)
                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jLabel28)
                                            .addComponent(cboSecteur, javax.swing.GroupLayout.PREFERRED_SIZE, 62, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                    .addGroup(layout.createSequentialGroup()
                                        .addGap(48, 48, 48)
                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(cboSalle, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(jLabel27))))))
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1)
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(tfNumeroDeSerie, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(tfNom, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel4)
                    .addComponent(tfDescriptif, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel5)
                    .addComponent(jLabel7)
                    .addComponent(tfGarantie, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(cboDateAchatJour, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(cboDateAchatMois, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(cboDateAchatAnnee, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel6)
                    .addComponent(tfPrix, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel9)
                    .addComponent(tfAmortissement, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel8)
                    .addComponent(tfBonDeCommande, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel10)
                    .addComponent(tfProcesseur, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel17)
                    .addComponent(tfOS, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel11)
                    .addComponent(jLabel18)
                    .addComponent(tfDisqueDur, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel12)
                    .addComponent(jLabel19)
                    .addComponent(tfRam, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(tfLecteurDisquette, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel13)
                    .addComponent(jLabel20)
                    .addComponent(tfCarteMere, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(tfLecteurZip, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel14)
                    .addComponent(jLabel21)
                    .addComponent(tfCarteSon, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(tfLecteurCD, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel15)
                        .addComponent(jLabel22)
                        .addComponent(tfLecteurDVD, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(tfCarteGraphique, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel23)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel16)
                        .addComponent(tfCarteReseau, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(tfGraveurCD, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel24)
                    .addComponent(tfGraveurmDVD, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel29)
                    .addComponent(tfGraveurpDVD1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel30)
                    .addComponent(tfGraveurpmDVD, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 16, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel26)
                    .addComponent(jLabel25)
                    .addComponent(jLabel27)
                    .addComponent(jLabel28))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(cboSecteur, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(cboSalle, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(cboMarque, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(cboFournisseur, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(bEnregistrer)
                    .addComponent(bAnnuler))
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void tfAmortissementActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tfAmortissementActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_tfAmortissementActionPerformed

    private void tfRamActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tfRamActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_tfRamActionPerformed

    private void tfLecteurDVDActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tfLecteurDVDActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_tfLecteurDVDActionPerformed

    private void tfCarteGraphiqueActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tfCarteGraphiqueActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_tfCarteGraphiqueActionPerformed

  private void bAnnulerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bAnnulerActionPerformed
    // TODO add your handling code here:
	this.setVisible(false);
  }//GEN-LAST:event_bAnnulerActionPerformed

  private void cboFournisseurActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cboFournisseurActionPerformed
    // TODO add your handling code here:
  }//GEN-LAST:event_cboFournisseurActionPerformed

  private void bEnregistrerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bEnregistrerActionPerformed
    // TODO add your handling code here:
  }//GEN-LAST:event_bEnregistrerActionPerformed


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton bAnnuler;
    private javax.swing.JButton bEnregistrer;
    private javax.swing.JComboBox cboDateAchatAnnee;
    private javax.swing.JComboBox cboDateAchatJour;
    private javax.swing.JComboBox cboDateAchatMois;
    private javax.swing.JComboBox cboFournisseur;
    private javax.swing.JComboBox cboMarque;
    private javax.swing.JComboBox cboSalle;
    private javax.swing.JComboBox cboSecteur;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JLabel jLabel26;
    private javax.swing.JLabel jLabel27;
    private javax.swing.JLabel jLabel28;
    private javax.swing.JLabel jLabel29;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel30;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JTextField tfAmortissement;
    private javax.swing.JTextField tfBonDeCommande;
    private javax.swing.JTextField tfCarteGraphique;
    private javax.swing.JTextField tfCarteMere;
    private javax.swing.JTextField tfCarteReseau;
    private javax.swing.JTextField tfCarteSon;
    private javax.swing.JTextField tfDescriptif;
    private javax.swing.JTextField tfDisqueDur;
    private javax.swing.JTextField tfGarantie;
    private javax.swing.JTextField tfGraveurCD;
    private javax.swing.JTextField tfGraveurmDVD;
    private javax.swing.JTextField tfGraveurpDVD1;
    private javax.swing.JTextField tfGraveurpmDVD;
    private javax.swing.JTextField tfLecteurCD;
    private javax.swing.JTextField tfLecteurDVD;
    private javax.swing.JTextField tfLecteurDisquette;
    private javax.swing.JTextField tfLecteurZip;
    private javax.swing.JTextField tfNom;
    private javax.swing.JTextField tfNumeroDeSerie;
    private javax.swing.JTextField tfOS;
    private javax.swing.JTextField tfPrix;
    private javax.swing.JTextField tfProcesseur;
    private javax.swing.JTextField tfRam;
    // End of variables declaration//GEN-END:variables
}
